/* Bootstrap imports */

@import './custom_bootstrap.scss';
@import '../node_modules/bootstrap/scss/bootstrap.scss';
@import '../node_modules/dragula/dist/dragula.css';

/* Bootstrap customizations */
.nav {
  // correct bug with menus
  flex-wrap: nowrap;
}
.nav-link {
  cursor: pointer;
  transition: all ease-in-out 150ms;
}
.nav:not(.nav-tabs) {
  .nav-link {
    padding-right: 1.3rem;
  }
}
.nav-tabs {
  .nav-link {
    border: none;
  }
  .nav-link.active,
  .nav-item.show .nav-link {
    color: $gray-100;
    box-shadow: inset 0 -2px 0 0 $blue;
  }
}
.nav.flex-column {
  .nav-link.active,
  .nav-item.show .nav-link {
    color: $gray-100;
    box-shadow: inset 2px 0 0 0 $blue;
    background-color: $component-active-bg;
  }
  .nav-link.running {
    box-shadow: inset -3px 0 0 0 $green;
  }
  .nav-link.active.running {
    box-shadow: inset 2px 0 0 0 $blue, inset -3px 0 0 0 $green;
  }
  .nav-link.need-restart {
    box-shadow: inset -3px 0 0 0 $orange;
  }
  .nav-link.active.need-restart {
    box-shadow: inset 2px 0 0 0 $blue, inset -3px 0 0 0 $orange;
  }
  // adjust nav badge position
  .nav-link .badge {
    margin-left: 0.5rem;
    margin-top: 2px;
  }
}

.custom-control-label::after {
  cursor: pointer;
}

.clickable {
  cursor: pointer;
}

.modal-body {
  overflow-y: auto;
  max-height: 65vh;
}
.form-control {
  letter-spacing: 0.02rem;

  &[readonly] {
    color: $text-muted;
  }
}
.input-group-text {
  font-style: italic;
  color: $gray-400;

  i {
    font-size: 1.2rem;
    line-height: 1.5rem;
  }
}
label {
  color: $gray-400;
}
.input-group-prepend, .input-group-append {
  i {
    font-size: 1.2rem;
    line-height: 1.5rem;
  }
  .btn {
    // remove input group btn big padding 8/16px (do not know where it comes from)
    padding: 1px 6px;

    i {
      font-size: 1.8rem;
      line-height: 1.5rem;
    }
  }
}

.btn {
  border-width: 0;
}

.btn.btn-icon {
  text-decoration: none;

  &:visited {
    text-decoration: none;
  }

  i {
    font-size: 1.3rem;
  }
  color: $gray-500;

  &:hover, &:active {
    color: $body-color;
    text-decoration: none;
  }

  &.active {
    color: $gray-200;
    box-shadow: inset 0 -2px 0 0 $blue;
    border-radius: 0;
  }
}

.btn-custom {
  @include button-variant($custom-gray, $custom-gray, $custom-gray, $custom-gray, $custom-gray, $gray-800);
  color: $gray-500;
  border-width: $btn-border-width;

  &:hover, &.dropdown-toggle {
    color: $gray-100;
  }

  &:focus,
  &.focus,
  &:not(:disabled):not(.disabled):active:focus, &:not(:disabled):not(.disabled).active:focus, .show > &.dropdown-toggle:focus {
    box-shadow: none;
  }
}

.btn-xs {
  // line-height: ensure proper height of button next to small input
  @include button-size($input-btn-padding-y-xs, $input-btn-padding-x-xs, $font-size-xs, $input-btn-line-height-xs, $btn-border-radius-xs);
}

.btn-group {
  .btn:first-of-type {
    border-right: 1px solid $gray-800;
  }

  .btn:last-of-type {
    border-left: 1px solid $gray-800;
  }
}

.custom-select {
  &:focus {
    color: $gray-200;
  }
}

// fix bootstrap flexfill which is incompatible with ace editor
.flex-fill {
  flex: 1 !important;
}

// add margin to the split dropdown caret, when there is text
.dropdown-toggle-split:not(:empty)::after, .dropup .dropdown-toggle-split:not(:empty)::after, .dropright .dropdown-toggle-split:not(:empty)::after {
  margin-left: 15px;
}

/* Icon font */

@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: local('Material Icons'),
    local('MaterialIcons-Regular'),
    url(../node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff2) format('woff2'),
    url(../node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff) format('woff'),
    url(../node_modules/material-design-icons/iconfont/MaterialIcons-Regular.ttf) format('truetype');
}

.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 16px;  /* Reflect html font size +2px */
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  vertical-align: text-bottom;

  /* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
  /* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;

  /* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;

  /* Support for IE. */
  font-feature-settings: 'liga';

  &-xs {
    font-size: 0.9rem;
  }
}

a:not([href]):not([tabindex]) {
  color: $gray-400;
}

/* Custom styles */

// custom scrollbar
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-thumb {
  background: darken($gray-900, 4%);
  border-radius: 20px;
}

::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 20px;
}

// ace editor custom scrollbar
.ace_scrollbar.ace_scrollbar-v::-webkit-scrollbar-thumb {
  background: lighten($gray-900, 5%);
}

::selection {
  background: $blue;
}

html {
  // reduce page size reduce everything in bootstrap
  font-size: 14px;
}

body {
  user-select: none;
  cursor: default;
  overflow: hidden;
  letter-spacing: 0.02rem;
}

html, body {
  height: 100vh;
}

select, input, .btn, .dropdown-item {
  transition: all ease-in-out 100ms;
}

.main-content {
  background-color: darken($gray-900, 2%);
}

.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-column {
  background-color: lighten($gray-900, 2%);

  &--environments {
    border-right: 2px solid lighten($gray-900, 6%);
  }

  &--routes {
    border-right: 1px solid lighten($gray-900, 2%);
  }

  &--width {
    min-width: 200px;
    max-width: 300px;
  }
}

.menu-list {
  overflow-x: hidden;
  overflow-y: auto;
}

.menu-subtitle {
  color: $gray-500;
  font-size: $small-font-size;
}

.scroll-content {
  overflow-x: hidden;
  overflow-y: scroll;
}

.doc-link {
  cursor: pointer;
  opacity: 0.5;
  padding: 0;
  vertical-align: baseline;

  &:hover {
    opacity: 1;
  }
}

// http methods badges
$http-methods: ('get', $blue), ('put', $orange), ('post', $green), ('delete', $red), ('head', $purple), ('patch', $teal), ('options', $dark-blue);
@each $method in $http-methods {
  .http-method-#{nth($method, 1)} {
    background-color: #{nth($method, 2)};
    color: $gray-900;
  }
}

.header {
  background-color: lighten($gray-900, 3%);
}

.footer {
  color: $gray-400;
  background-color: lighten($gray-900, 5%);

  .footer-item {
    padding: $spacer / 4 $spacer;
    display: inline-block;
    transition: all ease-in-out 200ms;
    cursor: pointer;

    &.lighter {
      color: $gray-200;
    }

    &.with-border-left {
      border-left: 1px solid lighten($gray-900, 5%);
    }

    &.with-border-right {
      border-right: 1px solid lighten($gray-900, 5%);
    }

    &:first-of-type {
      border-left: none;
    }
  }
}

.title-separator {
  border-bottom: 1px solid lighten($gray-900, 3%);
  margin-bottom: 1rem;
  padding-left: .25rem;
  padding-right: .25rem;
  padding-top: .25rem;
  margin-top: 1rem;
  color: $gray-400;
  top: -12px;

  &.is-first {
    margin-top: 0;
  }

  &.has-icon {
    border-bottom: none;
    padding-left: 0;

    .title-separator-text {
      margin-left: 22px;
      border-bottom: 1px solid lighten($gray-900, 3%);
      display: flex;

      div:nth-child(2) {
        flex-grow: 1;
        text-align: right;
        font-size: 0.8rem;
        margin-top: 0.2rem;

        .btn-link {
          padding: 0;
          font-size: 0.8rem;
          vertical-align: inherit;
        }
      }
    }

    .title-separator-icon {
      float:left;
    }
  }
}

.transition {
  transition: all ease-in-out 200ms;
}

.dimmed {
  opacity: 0.5;
}

.position-relative {
  position: relative;
}

.flex-fill {
  flex: 1;
}

.form-right {
  position: absolute;
  right: 0;
}

.server-icons {
  position: absolute;
  display: block;
  width: 10px;
  height: 10px;

  i {
    font-size: 13px;
  }

  &-proxy-mode {
    right: 10px;
    top: -4px;
    color: $blue;
  }

  &-https {
    right: 10px;
    top: 13px;
    color: $yellow;
  }

  &-cors {
    right: 10px;
    top: 28px;
    color: $cyan;
  }
}

.toasts-container {
  z-index: 5000;
  position: absolute;
  width: 250px;
  top: ($spacer / 2) + 2rem;
  right: $spacer / 2;

  .toast-success {
    .toast-body {
      background-color: $green;
      border-color: lighten($green, 10%);
    }
  }

  .toast-warning {
    .toast-body {
      background-color: $orange;
      border-color: lighten($orange, 10%);
    }
  }

  .toast-error {
    .toast-body {
      background-color: $red;
      border-color: lighten($red, 10%);
    }
  }
}

.headers-list {
  &:first-of-type {
    margin-top: 0;
  }

  margin-top: $spacer / 2;
}

@import '../node_modules/spinthatshit/src/loaders.scss';

.loader {
  @include loader02($size: 100px, $color: $gray-600, $border-size: 4px, $duration: 0.6s, $align: middle);
}

.message {
  text-align: center;
  font-size: $font-size-lg;
  color: darken($gray-600, 20%);
  font-weight: $font-weight-light;
}
